# coding=utf-8
from point2d import *
from color import *
import knn


def test():
    red = Color('red')
    blue = Color('blue')
    dataSet = [
        [Point2d(1.0, 2.0), red],
        [Point2d(1.2, 0.1), red],
        [Point2d(0.1, 1.4), blue],
        [Point2d(0.3, 3.5), blue],
        [Point2d(0.4, 3.5), blue]]

    output = knn.classify(Point2d(1.0, 2.0), dataSet, 10)
    print(output.value)


test()
